<?php

header('Content-type: application/xml');
echo '<?xml version="1.0" encoding="utf-8" ?>';

?>
<tags>
<?php
    foreach($tags as $key => $value) {
?>
    <tag name="<?php echo $key; ?>" count="<?php echo $value; ?>" />
<?php
}
?>
</tags>